let utils = require('../../../utils/utils.js')
Page({

    /**
     * Page initial data
     */
    data: {
        sceneId: '', //场景id
        status: 0, //是否拥有
        scene: '',
    },

    /**
     * Lifecycle function--Called when page load
     */
    onLoad(options) {
        let _this = this;
        let sceneId = options.id;
        let status = options.status;
        _this.setData({
            sceneId: sceneId,
            status: status,
        });
        utils.querySceneById(sceneId).then(res => {
            _this.setData({
                scene: res.data.data
            });
        }).catch(error => {
            console.error(error);
        });
    },

    /**
     * Lifecycle function--Called when page is initially rendered
     */
    onReady() {

    },

    /**
     * Lifecycle function--Called when page show
     */
    onShow() {

    },

    /**
     * Lifecycle function--Called when page hide
     */
    onHide() {

    },

    /**
     * Lifecycle function--Called when page unload
     */
    onUnload() {

    },

    /**
     * Page event handler function--Called when user drop down
     */
    onPullDownRefresh() {

    },

    /**
     * Called when page reach bottom
     */
    onReachBottom() {

    },

    /**
     * Called when user click on the top right corner to share
     */
    onShareAppMessage() {

    },

    connWifi(e) {
        const { wifi, password } = e.detail.value;
        if (wifi === '') {
            utils.toast("请输入WiFi账号");
            return;
        }
        if (password === '') {
            utils.toast("请输入WiFi密码");
            return;
        }
        
    }
})